package com.njsoft.bodyawakening.table.adapter;

import android.support.annotation.Nullable;
import android.view.Display;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.njsoft.bodyawakening.R;
import com.njsoft.bodyawakening.utils.APPInfo;
import com.njsoft.bodyawakening.utils.TimeUtil;
import com.njsoft.bodyawakening.view.MyTextView;

import java.util.List;

/**
 * 时间插件
 */
public class TableTimeAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
    public TableTimeAdapter(int layoutResId, @Nullable List<String> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {
        MyTextView textView = helper.getView(R.id.mTableTime);

        String time = TimeUtil.getTimeHH(System.currentTimeMillis());
        if (item.contains(time)) {
            textView.setTextColor(mContext.getResources().getColor(R.color.red_normal));
        }
        textView.setText(item);
    }
}
